/*
 * @Descripttion:
 * @Author: voanit
 * @Date: 2022-05-11 15:48:13
 * @LastEditors: voanit
 * @LastEditTime: 2022-05-14 09:14:05
 */
var initList = [
  { id: 1, name: '吃饭', isDone: false },
  { id: 2, name: '睡觉', isDone: true },
]
export default function todos(list = initList, action) {
  console.log(action, 777)
  switch (action.type) {
    case 'add':
      return [...list, { id: 1, name: '喝水', isDone: false }]
    case 'add/head':
      return [...list, ...action.payload]
    default:
      return list
  }
}
